<template>
	<view class="container" :style="{paddingTop:`${statusBarHeight}px`}">
		<image class="bg" src="@/static/image/Wallet-ng.png" mode="widthFix"></image>
		<view class="main">
			<view class="nav">
				Wallet
			</view>
			<view class="list">
				<view class="col" v-for="(item,index) in list">
					<view class="item">
						<view class="upper">
							{{item.wallet_name}}
							<navigator :url="`./withdraw?id=${item.id}`"> <text>Withdraw</text></navigator>
						</view>
						<view class="num">
							<text>{{item.currency_unit}}</text>{{item.money}}
						</view>
						<view class="text">
							{{item.currency_tips}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<tabbar active="2" />
	</view>
</template>

<script>
	import tabbar from "@/components/tabbar.vue"
	export default {
		components: {
			tabbar
		},
		data() {
			return {
				statusBarHeight: uni.getStorageSync('statusBarHeight'),
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				this.$post("/user/wallets").then(res => {
					this.list = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F1F2F7;
	}

	.container {
		padding: 32rpx;
		position: relative;

		.bg {
			position: fixed;
			width: 100%;
			height: 100%;
			left: 0;
			top: 0;
		}

		.main {
			position: relative;
		}
	}

	.nav {
		text-align: center;
		color: #fff;
		font-size: 36rpx;
		padding: 30rpx 0;
	}

	.list {
		.col {
			padding: 8rpx 0;

			.item {
				background: #FFFFFF;
				border-radius: 8rpx;
				padding: 36rpx;

				.upper {
					font-size: 32rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					text {
						background: #0C0E27;
						border-radius: 4rpx;
						color: #fff;
						font-size: 30rpx;
						padding: 8rpx 20rpx;
					}
				}

				.num {
					font-size: 56rpx;
					font-weight: bold;
					padding: 20rpx 0;

					text {
						font-size: 30rpx;
					}
				}

				.text {
					color: #999;
					font-size: 24rpx;

					text {
						color: #0c0e27;
						font-weight: bold;
					}
				}
			}
		}
	}
</style>